﻿<local:DocumentBase x:Class="WPFExcelReport.BATCHMOVSUM"
                    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                    xmlns:local="clr-namespace:ReflectionStudio.Components.UserControls;assembly=ReflectionStudio.Core"
                    xmlns:db="clr-namespace:ReflectionStudio.Core.Database;assembly=ReflectionStudio.Core"
                    xmlns:fd="clr-namespace:Labs.Filtering;assembly=ReflectionStudio.Core"
                    xmlns:wep="clr-namespace:WPFExcelReport"
                      
                    xmlns:ucd="clr-namespace:ReflectionStudio.Controls;assembly=ReflectionStudio.Controls"
                    Loaded="Window_Loaded"
                    Title="成品仓统计情况"  
                    HorizontalAlignment="Stretch"  Margin="0,0,0,0"  VerticalAlignment="Stretch" >
    <local:DocumentBase.Resources>
        <Style x:Key="GroupHeaderStyle" TargetType="{x:Type GroupItem}">
            <Setter Property="Template">
                <Setter.Value>
                    <ControlTemplate TargetType="{x:Type GroupItem}">
                        <Expander x:Name="exp" IsExpanded="True"
                          Background="White"
                          Foreground="Black">
                            <Expander.Header>
                                <StackPanel Orientation="Horizontal">
                                    <TextBlock Text="{Binding Path=ARTICLE}" />
                                    <TextBlock Text="{Binding Path=ItemCount}"/>
                                    <TextBlock Text="Items"/>
                                </StackPanel>
                            </Expander.Header>
                            <ItemsPresenter />
                        </Expander>
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
        </Style>
        <db:INTEXDataSet x:Key="iNTEXDataSet" />
        <CollectionViewSource  x:Key="FlickrGroupedFeed" Source="{Binding Path=WBBEW,Source={StaticResource iNTEXDataSet}}">
        </CollectionViewSource>
    </local:DocumentBase.Resources>
    <Grid DataContext=""  HorizontalAlignment="Stretch"  Margin="10,10,0,0"  VerticalAlignment="Stretch">
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto" />
            <RowDefinition Height="Auto" />
            <RowDefinition Height="Auto" />
        </Grid.RowDefinitions>
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="600" />
            <ColumnDefinition Width="400" />
        </Grid.ColumnDefinitions>
        <WrapPanel Grid.Row="0" Grid.Column="0" Grid.ColumnSpan="2" Name="zoneCommand" Height="34" Margin="0,0,0,6">
            <Button  Content="查询"  Height="23" Margin="10,0,0,0"  Name="btnQuery" Width="75" Click="btnQuery_Click" />
            <Button Content="仅生成报表" Margin="10,0,0,0"   Height="23"   Name="btnReport" Width="75" Click="btnReport_Click" />
            <Button Content="打印报表" Margin="10,0,0,0"  Height="23" Name="btnPrint" Width="90" Click="btnPrint_Click"/>
            <Button Content="浏览数据"  Margin="10,0,0,0"  Height="23"  Name="btnPrintPreview" Width="90" Click="btnPrintPreview_Click"/>
        </WrapPanel>
        <StackPanel Grid.Row="1" Grid.Column="0" Grid.ColumnSpan="2">
            <WrapPanel >
                <Label Content="缸号"    Width="51" Margin="10,0,0,0"  HorizontalAlignment="Left" 
                       FontSize="18" VerticalAlignment="Center" Foreground="#FF1D1D1D" />
                <TextBox Name="txtBATCHNO" Width="138" Margin="10,0,0,0"  HorizontalAlignment="Left" CharacterCasing="Upper"
                         Background="Pink" FontSize="18" />
            </WrapPanel>
        </StackPanel>
        <WrapPanel Grid.Row="2"  Grid.Column="0"  Grid.ColumnSpan="2">
            <fd:FilteringDataGrid 
            AutoGenerateColumns="False" EnableRowVirtualization="True"  
                                                ItemsSource="{Binding}" 
                                            HeadersVisibility="Column"
                                              x:Name="MasterDg" 
                                                 CanUserReorderColumns="True"  
                                             CanUserResizeRows="True"
                                              CanUserSortColumns="True"
                                              IsFilteringCaseSensitive="False" 
                                              RowDetailsVisibilityMode="VisibleWhenSelected"   
                                              Width="Auto"
                                              Height="500"
                                              EnableColumnVirtualization="True"  
                                              ScrollViewer.HorizontalScrollBarVisibility="Auto"
                                              ScrollViewer.VerticalScrollBarVisibility="Auto"
                                              SelectionChanged="ItemsControls_SelectionChanged"
                                              >
                <DataGrid.Columns>
                    <!--WBBDPART,WBBART,WBBVAR,WBBFARBE,WBBBESCHICH,INCOMEQTY,INCOMEMTR,SHIPQTY,SHIPMTR,INSPECTQTY,INSPECTMTR,REWORKQTY,
                        REWORKMTR,CGRADEQTY,CGRADEMTR,PRDQTY,PRDMTR,SALESQTY,SALESMTR,RETURNQTY,RETURNMTR-->
                    <DataGridTextColumn Binding="{Binding Path=WBBDPART}" Header="缸号" Width="SizeToHeader" MinWidth="70" />
                    <DataGridTextColumn Binding="{Binding Path=WBBART}" Header="品种编号" Width="SizeToHeader"  MinWidth="50" />
                    <DataGridTextColumn Binding="{Binding Path=WBBVAR}" Header="版本"  Width="20" />
                    <DataGridTextColumn Binding="{Binding Path=WBBFARBE}" Header="色号" Width="20" />
                    <DataGridTextColumn Binding="{Binding Path=WBBBESCHICH}" Header="后整套色" Width="50" />
                    <DataGridTextColumn Binding="{Binding Path=CHECKEDQTY}" Header="可发匹数"  Width="30" />
                    <DataGridTextColumn Binding="{Binding Path=CHECKEDMTR}" Header="可发区码数" Width="SizeToCells"  MinWidth="30" />
                    <DataGridTextColumn Binding="{Binding Path=UNCHECKEDQTY}" Header="待检匹数" Width="30" />
                    <DataGridTextColumn Binding="{Binding Path=UNCHECKEDMTR}" Header="待检区码数" Width="SizeToCells"  MinWidth="30" />
                    <DataGridTextColumn Binding="{Binding Path=INSPECTQTY}" Header="在质检" Width="30" />
                    <DataGridTextColumn Binding="{Binding Path=INSPECTMTR}" Header="在质检码数" Width="SizeToCells"  MinWidth="30" />
                    <DataGridTextColumn Binding="{Binding Path=REWORKQTY}" Header="在返修" Width="30" />
                    <DataGridTextColumn Binding="{Binding Path=REWORKMTR}" Header="在返修码数" Width="SizeToCells"  MinWidth="30" />
                    <DataGridTextColumn Binding="{Binding Path=CGRADEQTY}" Header="C布" Width="30" />
                    <DataGridTextColumn Binding="{Binding Path=CGRADEMTR}" Header="C布码数" Width="SizeToCells"  MinWidth="30" />
                    <DataGridTextColumn Binding="{Binding Path=PRDQTY}" Header="生产入仓匹数" Width="30" />
                    <DataGridTextColumn Binding="{Binding Path=PRDMTR}" Header="生产入仓码数" Width="SizeToCells"  MinWidth="30" />
                    <DataGridTextColumn Binding="{Binding Path=SALESQTY}" Header="销售出货匹数" Width="30" />
                    <DataGridTextColumn Binding="{Binding Path=SALESMTR}" Header="销售出货码数" Width="SizeToCells"  MinWidth="30" />
                    <DataGridTextColumn Binding="{Binding Path=RETURNQTY}" Header="销售退货匹数" Width="30" />
                    <DataGridTextColumn Binding="{Binding Path=RETURNMTR}" Header="销售退货匹数" Width="SizeToCells"  MinWidth="30" />
                    <DataGridTextColumn Binding="{Binding Path=INCOMEQTY}" Header="总入仓匹数" Width="30" />
                    <DataGridTextColumn Binding="{Binding Path=INCOMEMTR}" Header="总入仓码数" Width="SizeToCells"  MinWidth="30" />
                    <DataGridTextColumn Binding="{Binding Path=SHIPQTY}" Header="总出货匹数" Width="30" />
                    <DataGridTextColumn Binding="{Binding Path=SHIPMTR}" Header="总出货码数" Width="SizeToCells"  MinWidth="30" />
                </DataGrid.Columns>
            </fd:FilteringDataGrid>
        </WrapPanel>
    </Grid>
</local:DocumentBase>
